import request from '@/utils/request'

const getAgents = function() {
  return request({
    url: '/SysAgent/listAll',
    method: 'get',
    data: {}
  })
}

const getProducts = function(agentCode) {
  return request({
    url: '/SysAgent/getProducts',
    method: 'get',
    params: {
      agentCode: agentCode
    }
  })
}

const getSetMeal = function() {
  return request({
    url: '/sysSetMeal/allSetMeal',
    method: 'get',
    params: {}
  })
}

const updateProducts = function(data) {
  return request({
    url: '/SysAgent/updateProducts',
    method: 'post',
    data: data
  })
}

export const productsApi = {
  getAgents: getAgents,
  getProducts: getProducts,
  getSetMeal: getSetMeal,
  updateProducts: updateProducts
}
